package handler

import (
	"Gin/global/model"
	"VipSrv/vip"
	context2 "context"
	"fmt"
	"github.com/gin-gonic/gin"
	"github.com/smartwalle/alipay/v3"
)

func PayReturn(context *gin.Context) {
	context.Request.ParseForm()
	order_on := context.Request.Form.Get("out_trade_no")
	status := context.Request.Form.Get("trade_status")
	alipay.ACKNotification(context.Writer)
	fmt.Println(order_on, status)
	model.VipClient.VipReturn(context2.Background(), &vip.VipReturnRequest{
		OrderNo: order_on,
		Status:  status,
	})
}
